package com.ccrfid.rmc6.pojo;

import java.util.Arrays;
import java.util.List;

public class Constants {
    public static final String authType = "Bearer";
    public static final String signKey = "VG8gYmUsIG9yIG5vdCB0byBiZSwgdGhhdCBpcyB0aGUgcXVlc3Rpb24u";
    public static final String issuer = "ccrfid.com";

    public enum MAP_LEVEL {
        ONE(1, "一级地图"),
        TWO(2, "二级地图"),
        THREE(3, "三级地图"),
        ;
        public Integer id;
        public String name;

        MAP_LEVEL(Integer id, String name) {
            this.id = id;
            this.name = name;
        }
    }

    public enum ONLINE_STATUS {
        ONLINE(1, "在线"),
        OFFLINE(0, "离线"),;
        public Integer id;
        public String name;

        ONLINE_STATUS(Integer id, String name) {
            this.id = id;
            this.name = name;
        }
    }

    public enum ENABLE_STATUS {
        ENABLE(1, "启用"),
        DISABLE(0, "禁用"),;
        public Integer id;
        public String name;

        ENABLE_STATUS(Integer id, String name) {
            this.id = id;
            this.name = name;
        }
    }

    public enum CUTOFF_STATUS {
        NORMAL(0, "正常"),
        CUTOFF(1, "剪断"),;
        public Integer id;
        public String name;

        CUTOFF_STATUS(Integer id, String name) {
            this.id = id;
            this.name = name;
        }
    }

    public enum LOWPOWER_STATUS {
        LOWPOWER(1, "低电"),
        NORMAL(0, "正常"),;
        public Integer id;
        public String name;

        LOWPOWER_STATUS(Integer id, String name) {
            this.id = id;
            this.name = name;
        }
    }

    public enum DICT_TYPE {
        PERSONNEL_TYPE(11, "人员类型"),
        MANAGER_TYPE(12, "管教类型"),
        ACTIVITY_TYPE(13, "行为类型"),
        FOCUSED_PRISONER_TYPE(15, "重点关注类型"),
        CARD_TYPE(21, "标签类型"),
        LOCATOR_TYPE(22, "定位器类型"),
        ALERTER_TYPE(23, "报警器类型"),
        LOCATION_TYPE(31, "区域类型"),
        VIDEO_PLATFORM_TYPE(51, "视频平台"),
        VIDEO_DEVICE_TYPE(52, "视频设备"),
        CAMERA_TYPE(53, "摄像机类型"),
        ORG_TYPE(61, "机构类型"),;

        public Integer id;
        public String name;

        DICT_TYPE(Integer id, String name) {
            this.id = id;
            this.name = name;
        }
    }

    public enum PERSONNEL_TYPE {
        PRISONER(101, "在押人员"),
        WORKER(102, "工作人员"),
        VISITOR(103, "外来人员"),
        POLICE(104, "民警"),
        WEN_ZHI(105, "文职"),
        TE_QIN(106, "特勤"),
        MEDICAL_WORKER(107, "医务人员"),
        DUSTMAN(108, "勤务工"),
        WU_JING(109, "武警"),
        LAWYER(110, "律师"),
        FAMILY(111, "家属"),
        WAI_LAI_WU_GONG(112, "外来务工"),
        PRISONER_DEATH(150, "死刑犯"),
        PRISONER_MAJOR_CRIMINAL(151, "重刑犯"),
        PRISONER_INFECTED(152, "危重病犯"),
        PRISONER_FOCUSED(153, "重点人员"),
        ;

        public Integer id;
        public String name;

        PERSONNEL_TYPE(Integer id, String name) {
            this.id = id;
            this.name = name;
        }
    }

    public static final class PERSONNEL_TYPE_LIST {
        public static final List<Integer> list = Arrays.asList(new Integer[]{1, 2,});
    }

    public enum MANAGER_TYPE {
        MAIN(121, "主管"),
        ASSIST(122, "协管"),;

        public Integer id;
        public String name;

        MANAGER_TYPE(Integer id, String name) {
            this.id = id;
            this.name = name;
        }
    }

    public enum CARD_TYPE {
        BAND(201, "腕带"),
        CARD(202, "卡片"),
        ASSET(203, "资产标签"),
        TAG(204, "精确定位标签"),
        VEHICLE(205, "车辆标签"),
        ;

        public Integer id;
        public String name;

        CARD_TYPE(Integer id, String name) {
            this.id = id;
            this.name = name;
        }
    }

    public enum ALARM_LEVEL {
        MINOR(401, "次要"),
        MAJOR(402, "重要"),
        CRITICAL(403, "紧急"),;

        public Integer id;
        public String name;

        ALARM_LEVEL(Integer id, String name) {
            this.id = id;
            this.name = name;
        }
    }

    public enum ALARM_TYPE {
        CALL(406, "呼叫"),
        CUTOFF(407, "拆断"),
        LOWPOWER(408, "低电"),
        OFFLINE(409, "离线"),

        ENTER_ALARM(411, "非法进入"),
        GATHER_ALARM(412, "非法聚集"),
        OUT_OF_CONTROL(413, "脱离管控"),
        WRONG_LOCATION(414, "错误区域"),
        WRONG_ROOM(415, "串监"),
        STAY_ALARM(416, "滞留"),
        LEAVE_ALARM(417, "非授权离开"),
        MUTUAL_ALARM(418, "互监"),
        MUTEX_ALARM(419, "非法同行"),

        MIN_HEART_RATE(441,"心率过低"),
        MAX_HEART_RATE(442,"心率过高"),
        MIN_DIASTOLIC_PRESSURE(443,"舒张压过低"),
        MAX_DIASTOLIC_PRESSURE(444,"舒张压过高"),
        MIN_SYSTOLIC_PRESSURE(445,"收缩压过低"),
        MAX_SYSTOLIC_PRESSURE(446,"收缩压过高"),
        MIN_TEMPERATURE(447,"体温过低"),
        MAX_TEMPERATURE(448,"体温过高"),
        ;

        public Integer id;
        public String name;

        ALARM_TYPE(Integer id, String name) {
            this.id = id;
            this.name = name;
        }
    }

    public enum PERSONNEL_GROUP_TYPE {
        MUTUAL(0, "互监组"),
        MUTEX(1, "互斥组"),
        ;

        public Integer id;
        public String name;

        PERSONNEL_GROUP_TYPE(Integer id, String name) {
            this.id = id;
            this.name = name;
        }
    }

    public enum ORG_TYPE {
        POLICE(601, "办公机构"),
        PRISONER(602, "看管机构"),;

        public Integer id;
        public String name;

        ORG_TYPE(Integer id, String name) {
            this.id = id;
            this.name = name;
        }
    }

    public enum VIDEO_RES_TYPE {
        ORG(1001, "机构资源类型"),
        CAMERA(1002, "摄像头资源类型"),;

        public Integer id;
        public String name;

        VIDEO_RES_TYPE(Integer id, String name) {
            this.id = id;
            this.name = name;
        }
    }

    public enum LOCATION_TYPE {
        JianQv(301, "监区"),
        TiXun(302, "提讯区"),
        LvShiHuiJian(303, "律师会见区"),
        JiaShuHuiJian(304, "家属会见区"),
        ShouYa(305, "收押区"),
        TanHua(306, "谈话区"),
        BanGong(307, "办公区"),
        YanGuan(308, "严管区"),
        YiWu(309, "医务区"),
        GongChang(310, "工厂区"),

        JS(311, "监室"),
        FFC(312, "放风场"),
        JQZL(313, "监区走廊"),
        JQTD(314, "监区通道"),
        PATROL(315, "巡视道"),
        ;

        public Integer id;
        public String name;

        LOCATION_TYPE(Integer id, String name) {
            this.id = id;
            this.name = name;
        }
    }

    public enum NODE_TYPE {
        CATALOG(701, "目录"),
        NODE(702, "节点"),
        ;

        public Integer id;
        public String name;

        NODE_TYPE(Integer id, String name) {
            this.id = id;
            this.name = name;
        }
    }

    public enum BED_STATE {
        ON(1, "在床"),
        OFF(2, "离床"),
        MOV(3, "体动"),
        CALL(4, "呼叫"),
        ;

        public Integer id;
        public String name;

        BED_STATE(Integer id, String name) {
            this.id = id;
            this.name = name;
        }
    }

    public enum WET_STATE {
        NO(0, "非尿湿"),
        YES(1, "尿湿"),
        ;

        public Integer id;
        public String name;

        WET_STATE(Integer id, String name) {
            this.id = id;
            this.name = name;
        }
    }

    public enum SLEEP_STATE {
        ERR(-1, "错误"),
        NOT(0, " 清醒"),
        START(1, "开始入睡"),
        LIGHT(2, "浅睡"),
        DEEP(3, "深睡"),
        ;

        public Integer id;
        public String name;

        SLEEP_STATE(Integer id, String name) {
            this.id = id;
            this.name = name;
        }
    }

    public enum BED_ALARM_TYPE {
        OFFLINE(0, "离线"),
        HEART_LOW(1, " 心率过低"),
        HEART_HIGH(2, "心率过高"),
        BREATH_LOW(3, "呼吸频率过低"),
        BREATH_HIGH(4, "呼吸频率过高"),
        HEART_LOW_REMOVE(10, " 心率过低告警解除"),
        HEART_HIGH_REMOVE(20, "心率过高告警解除"),
        BREATH_LOW_REMOVE(30, "呼吸频率过低告警解除"),
        BREATH_HIGH_REMOVE(40, "呼吸频率过高告警解除"),
        ;

        public Integer id;
        public String name;

        BED_ALARM_TYPE(Integer id, String name) {
            this.id = id;
            this.name = name;
        }
    }

    public enum VIDEO_VERSION {
        HK_ARTEMIS_B(521, "海康云综合安防平台-网页播放器"),
        HK_ARTEMIS_C(522, "海康云综合安防平台-客户端播放器"),
        HK_OPEN8200(523, "海康Open8200视频能力开放平台"),
        ;

        public Integer id;
        public String name;

        VIDEO_VERSION(Integer id, String name) {
            this.id = id;
            this.name = name;
        }
    }

    public enum CQ_PATROL_EVENT {
        START(1, "巡更开始"),
        ENTER(2, "到达巡更点区域"),
        FINISH(3, "巡更结束"),
        TIMEOUT(4, "超时未开始提醒"),
        ;

        public Integer id;
        public String name;

        CQ_PATROL_EVENT(Integer id, String name) {
            this.id = id;
            this.name = name;
        }
    }

    public enum DOWN__ERROR_INFO {
        BUSY("Busy now. Try later!", "下发失败，系统繁忙，请稍后重试！"),
        TIME_OUT("java.net.SocketTimeoutException: Read timed out", "下发失败，接口返回超时，请重试！"),
        ERROR("", "下发失败，响应超时，请稍后重试！"),
        NOT_FOUND("beacon not found", "下发失败，标签未找到！"),
        ;

        public String returnInfo;
        public String resultInfo;

        DOWN__ERROR_INFO(String returnInfo, String name) {
            this.returnInfo = returnInfo;
            this.resultInfo = name;
        }

        public static String getResultInfo(String returnInfo){
            DOWN__ERROR_INFO[] carTypeEnums = values();
            for (DOWN__ERROR_INFO carTypeEnum : carTypeEnums) {
                if (carTypeEnum.returnInfo().equals(returnInfo)) {
                    return carTypeEnum.resultInfo();
                }
            }
            return "下发失败";
        }
        private String returnInfo() {
            return this.returnInfo;
        }
        private String resultInfo() {
            return this.resultInfo;
        }
    }

}
